<?php

use Faker\Generator as Faker;

$factory->define(App\Model\News::class, function (Faker $faker) {
    //sentence() 是 faker 提供的 API ，随机生成『小段落』文本
    $sentence = $faker->sentence();
    // 随机取一个月以内的时间
    $time = $faker->dateTimeThisMonth();
    return [
        'title' => $faker->title,
        'ctitle' => $faker->name,
        'classify' => $faker->numberBetween(1,6),
        'keywords' => $faker->city,
        'description' => $sentence,
        'content' => $faker->realText($faker->numberBetween(200,500)),
        'author' => '荣智文化',
        'imgurl' => $faker->imageUrl($width = 640, $height = 480),
        'link' => 'http://www.hao123.com',
        'top' => '0',
        'created_at' => $time,
        'updated_at' => $time,
    ];
});
